<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>

<body>
    <div id="app">
        <cpn></cpn>
        <cpn>
            <span>汉语 -</span>
            <span>英语 -</span>
            <span>阿拉伯语 -</span>
            <span>日语 -</span>
        </cpn>
        <cpn>
            <template v-slot:list='slot'>
                <!-- <span>{{slot.data.join(' - ')}}</span> -->
                <span v-for="(item, index) in slot.data">{{item}} -</span>
            </template>
        </cpn>
    </div>
    <template id="cpn">
        <div>
            <slot :data="language" name="list">
                <ul>
                    <li v-for="item in language">{{ item }}</li>
                </ul>
            </slot>

        </div>
    </template>
    <script>
        const app = new Vue({
            el: '#app',
            data: {},
            methods: {},
            components: {
                cpn: {
                    template: '#cpn',
                    data() {
                        return {
                            language: ['汉语', '英语', '阿拉伯语', '日语']
                        }
                    }
                }
            }
        })
    </script>
</body>

</html>